import { BoughtCourse as Component } from '@/pagesComponents/BoughtCourse';
import { generateMetaData } from '@/shared/lib/meta';
import { GetServerSideProps } from 'next';
import Head from 'next/head';

export default function BoughtCourse({ id, tab }: { id: string; tab: string }) {
  return (
    <>
      <Head>
        <meta
          content={`app-id=1624893065, app-argument=try-companyName://bought-product/${tab}/${id}`}
          name="apple-itunes-app"
        />
        {generateMetaData({ title: undefined })}
      </Head>
      <Component />
    </>
  );
}
export const getServerSideProps: GetServerSideProps = async (context) => {
  const id = context.params?.id;
  const tab = context.params?.tab;
  if (typeof id !== 'string') {
    return {
      notFound: true,
    };
  }
  return {
    props: {
      id,
      tab,
    },
  };
};
